from django.shortcuts import render


def exception_handler_middleware(view_func):
    def wrapper(request, *args, **kwargs):
        try:
            return view_func(request, *args, **kwargs)
        except:
            return render(request, 'error.html')

    return wrapper
